﻿//  --------------------------------
//  Copyright (c) AW Systems, Inc. All rights reserved.
//  This source code is made available under the terms of the Microsoft Public License (Ms-PL)
//  http://www.codeplex.com/SLAM/license
//  ---------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;

namespace Slam
{
	/// <summary>
	/// Defines generic wrapper for Dependency Injection framework for use by SLAM.
	/// </summary>
	public interface IComponentFactory
	{
		/// <summary>
		/// Gets an instance of the given type T.
		/// </summary>
		/// <typeparam name="T">Type of instance to retrieve</typeparam>
		/// <returns>Instance of given Type</returns>
		T GetInstance<T>();

		/// <summary>
		/// Gets an instance of the given type T.
		/// </summary>
		/// <typeparam name="T">Type of instance to retrieve</typeparam>
		/// <param name="siteCollection">SiteCollection providing context for correspondence to a SLAM Configuration DataMapping</param>
		/// <param name="site">Site providing context for correspondence to a SLAM configured type </param>
		/// <param name="typeName">A SLAM configured type for which to retrieve a corresponding instance.</param>
		/// <returns>Instance of given Type</returns>
		T GetInstance<T>(string siteCollection, string site, string typeName);

		/// <summary>
		/// Gets an instance of the given type T.
		/// </summary>
		/// <typeparam name="T">Type of instance to retrieve</typeparam>
		/// <param name="siteCollection">SiteCollection providing context for correspondence to a SLAM Configuration DataMapping</param>
		/// <param name="site">Site providing context for correspondence to a SLAM configured type </param>
		/// <param name="id">List ID providing context for correspondence to a SLAM configured type</param>
		/// <param name="typeName">A SLAM configured type for which to retrieve a corresponding instance.</param>
		/// <returns>Instance of given Type</returns>
		T GetInstance<T>(string siteCollection, string site, string id, string typeName);

		/// <summary>
		/// Resets the underlying IoC container.
		/// </summary>
		void ResetContainer();
	}
}
